package com.szly.phm.common.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.szly.phm.common.entity.dto.permission.CreatePermissionDTO;
import com.szly.phm.common.entity.dto.permission.PermissionDTO;
import com.szly.phm.common.entity.dto.permission.PermissionSortDTO;
import com.szly.phm.common.entity.dto.permission.UpdatePermissionDTO;
import com.szly.phm.common.entity.dto.user.LoginUserDTO;
import com.szly.phm.common.entity.po.SysPermission;
import com.szly.phm.common.entity.result.PageResult;
import com.szly.phm.common.entity.result.RootResponse;
import com.szly.phm.common.entity.vo.permissiom.PermissionTreeVO;
import com.szly.phm.common.entity.vo.permissiom.PermissionVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author admin
 * @since 2021-07-02
 */
public interface ISysPermissionService extends IService<SysPermission> {

//    HashSet<LoginPermissionVO> queryPermissionsByRoleIds(@Param("roleIds") List<String> roleIds, AtomicBoolean supperAdmin);

    List<PermissionTreeVO> queryPermissionsByRoleIds1(@Param("roleIds") List<String> roleIds, AtomicBoolean supperAdmin);

    //分页查询权限
    RootResponse<PageResult<PermissionVO>> queryPermissionPage(PermissionDTO permissionDTO);

    RootResponse  treePermission();

    //添加权限
    RootResponse createPermission(CreatePermissionDTO permissionDTO, LoginUserDTO userDTO);

    //编辑权限
    RootResponse updatePermissin(UpdatePermissionDTO permissionDTO, LoginUserDTO userDTO);

    //删除权限
    RootResponse deletePermission(String id, LoginUserDTO userDTO);

    //调整权限顺序
    RootResponse changePermissionSort(List<PermissionSortDTO> sorts, LoginUserDTO userDTO);

    //构建idPath
    RootResponse resetIdPath();
}
